<template>
  <panel title="订单编辑">
    <div slot="btn">
      <el-button @click="back" type="success" size="small">返回</el-button>
      <el-button type="primary" size="small" @click="save">保存</el-button>
    </div>

      <el-form label-width="80px" size="small" :model="amend" >

        <el-form-item label="订单号" label-width="80px">
          <el-input v-model="amend.orderNo"></el-input>
        </el-form-item>

        <el-form-item label="下单时间" label-width="80px">
          <el-input v-model="amend.deliveryTime"></el-input>
        </el-form-item>

        <el-form-item label="手机号" label-width="80px">
          <el-input v-model="amend.phone"></el-input>
        </el-form-item>

        <el-form-item label="收货人" label-width="80px">
          <el-input v-model="amend.consignee"></el-input>
        </el-form-item>

        <el-form-item label="配送地址" label-width="80px">
          <el-input v-model="amend.deliverAddress"></el-input>
        </el-form-item>

        <el-form-item label="送达时间" label-width="80px">
          <el-input v-model="amend.orderTime"></el-input>
        </el-form-item>

        <el-form-item label="用户备注" label-width="80px">
          <el-input v-model="amend.remarks"></el-input>
        </el-form-item>

        <el-form-item label="订单金额" label-width="80px">
          <el-input v-model="amend.orderAmount"></el-input>
        </el-form-item>

        <el-form-item label="订单状态" label-width="80px">
          <el-input v-model="amend.orderState"></el-input>
        </el-form-item>

     

      </el-form>
  </panel>
</template>

<script>
// 引入组件
import Panel from "@/components/panel/Panel.vue";
// 引入local
import local from "@/utils/local";
import {editorder}from '@/api/order'

export default {
  // 注册
  components: {
    Panel,
  },
  data(){
    return{
      amend:{

      }
    }
  },
  // 生命周期
  created() {
     let orderInfo = local.get("orderInfo");
     this.amend=orderInfo
    console.log(orderInfo);
  },
  methods: {
    // 返回
    back() {
      this.$router.back(); // 返回
    },
   async save(){
     let res=await editorder(this.amend)
     this.$router.push("/order/order-list");
    }
  },
};
</script>

<style lang="less" scoped>
</style>